package org.tong.cfgs;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

import java.util.Date;

/**
 * @author
 * @date 2022-08-09 20:30
 */
@Configuration
public class RouterCfg {

    @Bean
    public RouterFunction<ServerResponse> initRouterFunction() {
        return RouterFunctions.route().GET("/hello", serverRequest -> {
            return ServerResponse.ok().bodyValue("hello route " + new Date());
        }).build();
    }
}
